package com.xinxin.leetcode.problem633;

/**
 * @author ShiXinXin
 * @date 2020-02-12 21:47
 */
class Solution {
    public boolean judgeSquareSum(int c) {
        for (int i = 0; i <= Math.sqrt(c); i++) {
            int temp = (int) Math.sqrt(c - i * i);
            if (temp * temp == c - i * i) {
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        System.out.println(new Solution().judgeSquareSum(0));
    }
}
